gtkplacessidebar: add open flags to other locations
authorCarlos Soriano <csoriano@gnome.org>
Wed, 24 Feb 2016 01:29:03 +0000 (20:29 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 24 Feb 2016 01:29:03 +0000 (20:29 -0500)
We weren't using the open flags on the other locations signal, which
makes impossible for applications like nautilus to act in the same
way that for any other location where the user can choose between
opening in the current view, in a new window or in a new tab.

Add the signal missing parameter in order to allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=754743

README.in
gtk/gtkfilechooserwidget.c
gtk/gtkplacessidebar.c

index e15a52ba1d6724e6a1b8e42a4346a375d75272d1..e44cd3e795548b2ef4d2d6febf761eedc7943eb1 100644 (file)
--- a/README.in
+++ b/README.in
@@ -95,6 +95,11 @@ Release notes for 3.20
   on having a theme-provided background, call gtk_render_background()
   from your ::draw handler.
 
+* The GtkPlacesSidebar added a GtkPlacesOpenFlags parameter to the
+  other-locations signal in order to allow opening new windows or
+  tabs as done with other locations. This breaks the API for those
+  using the other-locations signal.
+
 Release notes for 3.18
 ======================
 
index c93c9a15655864d47e10c453d534bfcb9b27ef7f..78b870a3d67cabf91b396ab807006605ee81e6fc 100644 (file)
@@ -2832,6 +2832,7 @@ location_mode_set (GtkFileChooserWidget *impl,
 /* Callback used when the places sidebar asks us to show other locations */
 static void
 places_sidebar_show_other_locations_cb (GtkPlacesSidebar     *sidebar,
+                                        GtkPlacesOpenFlags    open_flags,
                                         GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = impl->priv;
index 5e74d99aec62eeaf0d93dd333345a25846cf6930..3de9e2cd66c0613e066ea1d3f79c52b7c4a3e49a 100644 (file)
@@ -340,9 +340,11 @@ emit_show_enter_location (GtkPlacesSidebar *sidebar)
 }
 
 static void
-emit_show_other_locations (GtkPlacesSidebar *sidebar)
+emit_show_other_locations (GtkPlacesSidebar   *sidebar,
+                           GtkPlacesOpenFlags  open_flags)
 {
-  g_signal_emit (sidebar, places_sidebar_signals[SHOW_OTHER_LOCATIONS], 0);
+  g_signal_emit (sidebar, places_sidebar_signals[SHOW_OTHER_LOCATIONS], 0,
+                 open_flags);
 }
 
 static void
@@ -2311,7 +2313,7 @@ open_row (GtkSidebarRow      *row,
                 NULL);
 
   if (place_type == PLACES_OTHER_LOCATIONS)
-    emit_show_other_locations (sidebar);
+    emit_show_other_locations (sidebar, open_flags);
   else if (uri != NULL)
     open_uri (sidebar, uri, open_flags);
   else if (place_type == PLACES_CONNECT_TO_SERVER)
@@ -4308,12 +4310,16 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
   /**
    * GtkPlacesSidebar::show-other-locations:
    * @sidebar: the object which received the signal.
+   * @open_flags: a single value from #GtkPlacesOpenFlags specifying how it should be opened.
    *
    * The places sidebar emits this signal when it needs the calling
    * application to present a way to show other locations e.g. drives
    * and network access points.
    * For example, the application may bring up a page showing persistent
    * volumes and discovered network addresses.
+   * Since 3.20 the signal added the @open_flags parameter in order to be able
+   * to specify whether the user choose to open the other locations in a different
+   * tab or window. In this way it behaves like the open-location signal.
    *
    * Since: 3.18
    */
@@ -4324,7 +4330,8 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
                         G_STRUCT_OFFSET (GtkPlacesSidebarClass, show_other_locations),
                         NULL, NULL,
                         _gtk_marshal_VOID__VOID,
-                        G_TYPE_NONE, 0);
+                        G_TYPE_NONE, 1,
+                        GTK_TYPE_PLACES_OPEN_FLAGS);
 
   /**
    * GtkPlacesSidebar::mount: